﻿function subscription(url, name, unreadCount) {
    var self = this;
    
    self.url = url;
    self.name = name;
    self.unreadCount = ko.observable(unreadCount);

    self.displayName = ko.computed(function () {
        return '[' + self.unreadCount() + '] ' + self.name;
    });

    self.subStatus = ko.computed(function () {
        return self.unreadCount() == 0 ? 'no-items' : 'unread-items';
    });
}
